package base.shiro.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.support.StandardServletMultipartResolver;

/**
 *
 * @author SuperMan
 * @create 2020/10/19
 * @since 1.0.0
 */
@Configuration
public class MultipartFileUploadConfiguration {

    @Bean
    public MultipartResolver multipartResolver(){
        StandardServletMultipartResolver multipartResolver = new StandardServletMultipartResolver();
        return multipartResolver;
    }

//    @Bean
//    public MultipartConfigElement multipartConfigElement(){
//        MultipartConfigFactory multipartConfigFactory = new MultipartConfigFactory();
//        multipartConfigFactory.setMaxFileSize(DataSize.ofBytes(102400));
//        multipartConfigFactory.setMaxRequestSize(DataSize.ofBytes(204800 *));
//        return multipartConfigFactory.createMultipartConfig();
//    }
}